<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@ taglib prefix="html" uri="http://struts.apache.org/tags-html" %>
<%@ taglib prefix="bean" uri="http://struts.apache.org/tags-bean" %>
<%@ taglib prefix="logic" uri="http://struts.apache.org/tags-logic" %>
<%@ taglib prefix="nested" uri="http://struts.apache.org/tags-nested" %>
<jsp:useBean id="user" class="util.User" scope="session"/>
<jsp:useBean id="pager" class="util.Pager" scope="session"/>
<jsp:useBean id="membercommunity" class="model.MemberCommunity" scope="session"/>
<html>
<head>
    <title>MyITEA.com</title>
<% String path = request.getContextPath(); %>
<% String imagePath = path+"/common/image/"; %>
<% String uploadPath = path+"/uploadfiles/"; %>


<link href="<%=path %>/common/css/main.css" rel="stylesheet" type="text/css"/>
<link href="<%=path %>/common/css/databoard.css" rel="stylesheet" type="text/css"/>
<link href="<%=path %>/common/css/photoboard.css" rel="stylesheet" type="text/css"/>
<link href="<%=path %>/common/css/community.css" rel="stylesheet" type="text/css"/>
<style type="text/css">
	.pop { position: absolute;top: 100px;widows: 100px;visibility: hidden; background:#ffffff;border: 1px solid black;}
</style>
<script src="<%=path %>/common/jscript/main.js" type="text/javascript"> </script>
<script type="text/javascript">
	function showsub(n){
		var subdivs = subdiv.getElementsByTagName('div');
		for(var i=0;i<subdivs.length;i++){
			subdivs[i].style.display = "none";	
		}

		switch(n){
			case 1: 
				document.getElementById("autonomylayer").style.display = "";
				return true;
			case 2: 
				document.getElementById("photoboardlayer").style.display = "";
				return true;
			case 3: 
				document.getElementById("communitylayer").style.display = "";
				return true;
			case 4: 
				document.getElementById("freeboardlayer").style.display = "";
				return true;
			case 5: 
				document.getElementById("databoardlayer").style.display = "";
				return true;
			case 6: 
				document.getElementById("japaninfolayer").style.display = "";
				return true;
		}
	}
	
	function getBoard(u,b){
		var url = '<%=path%>/board/'+u;
		url = url + escape(encodeURIComponent(b));
		location.href=url;
	}
	
	function popmenu1(mid){

			if(document.all) {

				popmenu.style.pixelLeft = ( document.body.scrollLeft + event.x );
				popmenu.style.pixelTop = ( document.body.scrollTop + event.y );

			}
			
			var _viewInfo = popTd.getElementsByTagName('a')[0];
			_viewInfo.href = 'javascript:viewInfo(\''+mid+'\');';
			
			var _message = messageTd.getElementsByTagName('a')[0];
			_message.href = 'javascript:viewMessage(\''+mid+'\');';

			popmenu.style.visibility = "visible";

	}
	
	function popmenu2(){	
		popmenu.style.visibility = "hidden";
	}
	
	function viewInfo(m){
		var mid = m;
		var url = "<%=path%>/member/viewaction.do?method=viewInfo&mid="+mid;
		open(url,'_blank','width=450 scrollbars=yes');
		popmenu2();
	}
	
	function viewMessage(m){
		var mid = m;
		var url = "<%=path%>/member/message.do?method=getSendForm&mid="+mid;
		open(url,'_blank','width=390 height=400 scrollbars=yes');
		popmenu2();
	}
	
	function viewMessage_receive(m){
		var mid = m;
		var url = "<%=path%>/member/message.do?method=receive&category=list&mid="+mid;
		open(url,'_blank','width=390 height=400 scrollbars=yes');
	}
	
</script>


</head>

<div id="popmenu" class="pop" style="position: absolute;width: 70px;height: 60px;text-align: center;visibility: hidden;">
	<table style="width: 70px;height: 60px;position: relative;">
		<tbody>
		<tr id="topTr" onmouseover="changeBGC('topTr')" onmouseout="returnBGC('topTr')" style="text-align: center;">
			<td id="popTd"><html:link href="">회원정보</html:link></td></tr>
			
		<tr id="messageTr" onmouseover="changeBGC('messageTr')" onmouseout="returnBGC('messageTr')" style="text-align: center;">
			<td id="messageTd"><html:link href="">쪽지보내기</html:link></td></tr>

		<tr id="closeTr" onmouseover="changeBGC('closeTr')" onmouseout="returnBGC('closeTr')" style="text-align: center;">
			<td><html:link href="javascript:popmenu2();">[닫기]</html:link></td></tr>
		</tbody>
	</table>
</div>
<body style="margin: 0px;">
<!-- 팝업메뉴 -->

<table cellpadding="0" cellspacing="0" border="0" style="width: 980px;">
	<tr><td rowspan="2" style="width: 180px; text-align: center;height: 80px;">
		<html:link action="/welcome" module="" onfocus="blur()"><img src="<%=imagePath %>logo.jpg" border="0"/></html:link></td>
		<td style="font-size: 10px;height: 20px;text-align: right;">

<logic:match value="true" name="user" property="logon">
		<logic:greaterEqual value="8" name="user" property="userInfo.lvno">
			<html:link action="/admin" module="/admin">ADMIN</html:link>	 | 
		</logic:greaterEqual>
</logic:match>
		<html:link action="/welcome" module="">HOME</html:link>	 | 
		<html:link action="/signin" module="/member">JOIN</html:link> | 
		<html:link action="/sitemap" module="">SITEMAP</html:link>
		</td>
	</tr>
	<tr>
		<td style="text-align: right;width: 800px;height: 60px;border-left: 1px solid #999999;border-top: 1px solid #999999;">
		<html:link action="/intro" module="" onmouseover="showsub(1)" onfocus="blur()"><img src="<%=imagePath %>topmenu_01.jpg"/></html:link>
		<html:link action="/photoboard.do?method=setMenus" module="/board" onmouseover="showsub(2)" onfocus="blur()"><img src="<%=imagePath %>topmenu_02.jpg"/></html:link>
		<html:link action="/communitymain" module="/community" onmouseover="showsub(3)" onfocus="blur()"><img src="<%=imagePath %>topmenu_03.jpg"/></html:link>
		<html:link action="/boardmain" module="/board" onmouseover="showsub(4)" onfocus="blur()"><img src="<%=imagePath %>topmenu_04.jpg"/></html:link>
		<html:link action="/databoard.do?method=setMenus" module="/board" onmouseover="showsub(5)" onfocus="blur()"><img src="<%=imagePath %>topmenu_05.jpg"/></html:link>
	 	<html:link action="/freeboard.do?method=setMenus" module="/board" onmouseover="showsub(6)" onfocus="blur()"><img src="<%=imagePath %>topmenu_06.jpg"/></html:link>
		</td>
	</tr>
	<tr>
		<td style="text-align: center; height: 65px;vertical-align: top;width: 180px; padding-top: 5px;" rowspan="2">
		<div style="width: 180px;height: 65px;">

<!-- 로그 아웃 상태 -->

<logic:match name="user" property="logon" value="false">
	<div id="loginDiv">
		<form action="<%=path %>/member/loginaction.do" method="post" style="font-family: sans-serif;">
			<table border="0" cellpadding="0" cellspacing="0" width="180px;">
				<tr><td style="text-align: right;width: 135px;padding-right: 4px;"><img src="<%=imagePath %>login_idicon.jpg"/><input id="cookieID" type="text" name="mid" maxlength="12" class="loginform" tabindex="1" style="vertical-align: top;"/></td>
				<td rowspan="2" style="width: 45px;height: 40px;padding-right: 5px;">
				<input type="submit" value="OK" class="submitstyle" style="font-family: sans-serif;font-size: 8pt;height: 40px;width: 38px;vertical-align: top;" tabindex="3"/></td></tr>
			
				<tr><td style="text-align: right;width: 135px;padding-right: 4px;"><img src="<%=imagePath %>login_pwicon.jpg" style="vertical-align: bottom;"/><input type="password" name="mpass" maxlength="12" class="loginform" tabindex="2" style="vertical-align: bottom;"/></td></tr>
			
				<tr><td colspan="2" style="text-align: center;font-size: 8pt;"><input type="checkbox" name="cookiemid" tabindex="4" checked="checked"/>아이디기억
				<a href="<%=path %>/member/findpass.do">FIND ID/PASS&nbsp;</a>
				</td></tr>
			
			</table>
			<input type="hidden" name="method" value="login"/>
		</form></div>
</logic:match>
<!-- 아이디 쿠키 처리 -->
<script type="text/javascript">

	var cookies = document.cookie.split(";");
	var cookieText = document.getElementById('cookieID');
	for(var i=0;i<cookies.length;i++){
		var cookieNAV = cookies[i].split("=");
		var cookieName = cookieNAV[0];
		var cookieValue = cookieNAV[1];
		if(cookieName==" cookiemid"){
			if(cookieText!=null) {
				if(cookieValue!=null) cookieText.value = cookieValue;
				else cookieText.value = "";
				break;
			}
		}
	}

</script>

<!-- 로그 인 상태 -->
<logic:match name="user" property="logon" value="true">	
		<table border="0" cellpadding="0" cellspacing="0" style="width: 180px;">
			<tr><td><div id="logoutDiv" style="height: 20px;vertical-align: middle;font-family: sans-serif;">
		<span style="font-size: 8pt;color: #999999;">[lv.<%=user.getUserInfo().getLvno() %>]</span>
		<a href="javascript:;" onmousedown="popmenu1('<%=user.getMid() %>')" style="color: #2F4F4F;">
		<bean:write name="user" property="mid"/></a>
		</div></td></tr>
			
<!-- 유저의 쪽지 건수 표시 -->
			<tr>
				<td style="padding-bottom: 5px;">
				<div style="font-size: 8pt;">
				<%
					if(user.getMsg().equals("0"))
					{
						%>
						<img src="<%=imagePath %>message_n.gif" alt="메세지 열람" onclick="javascript:viewMessage_receive('<%=user.getMid() %>');" style="vertical-align: middle; cursor: hand;"> Messages
						(<bean:write name="user" property="msg"/>)
						<%
					}
					else
					{
						%>
						<img src="<%=imagePath %>message.gif" alt="메세지 열람" onclick="javascript:viewMessage_receive('<%=user.getMid() %>');" style="vertical-align: middle; cursor: hand;"> Messages
						(<bean:write name="user" property="msg"/>)
						<%
					}
				%>
				</div>
				</td>
			</tr>

			<tr><td>	<div style="height: 20px;vertical-align: middle;">
	<b><a href="<%=path %>/member/loginaction.do?method=logout">logout</a></b>
	<a href="javascript:location.href='<%=path %>/member/viewaction.do?method=view&mid=<bean:write name="user" property="mid"/>';" style="color: #999999;">정보변경/탈퇴</a></div></td></tr>


		</table>
		
</logic:match>
			
		</div></td>
		
<!-- 메뉴 사이 여백 -->
		<td style="height: 20px;border-left: 1px solid #999999;background: #dddddd;text-align: right;">
			<img src="<%=imagePath %>topmenu_01b.jpg"/>
			<img src="<%=imagePath %>topmenu_02b.jpg"/>
			<img src="<%=imagePath %>topmenu_03b.jpg"/>
			<img src="<%=imagePath %>topmenu_04b.jpg"/>
			<img src="<%=imagePath %>topmenu_05b.jpg"/>
			<img src="<%=imagePath %>topmenu_06b.jpg"/>
		</td></tr>

<!-- 서브 메뉴 -->		
		<tr><td style="text-align: center; width: 800px;height: 45px;background: #000000;border-bottom: 1px solid black;">
			<table style="width: 800px;height: 45px;">
				<tr>
					<td id="subdiv" style="border: 0;">
					<div id="autonomylayer" class="submenu" style="display: none;"><span>
						<html:link action="/intro" module="" styleClass="ma">자치회 소개</html:link>&nbsp;|&nbsp; 
						<html:link action="/comm" module="" styleClass="ma">자치회장 인사말</html:link>&nbsp;|&nbsp;
						<html:link action="/organogram" module="" styleClass="ma">자치회 조직도</html:link>&nbsp;|&nbsp;
						<html:link action="/rules" module="" styleClass="ma">자치회 규칙</html:link>&nbsp;|&nbsp;
						</span>
					</div>
					<div id="photoboardlayer" class="submenu" style="display: none;">
						<a class="ma" href="javascript:getBoard('photoboard.do?method=photoList&cono=4&pbname=','포토갤러리');">포토갤러리</a>&nbsp;|&nbsp;
					</div>
					<div id="communitylayer" class="submenu" style="display: none;">
						<html:link action="/communitymain" module="/community" styleClass="ma">커뮤니티</html:link>&nbsp;|&nbsp;
					</div>
					<div id="freeboardlayer" class="submenu" style="display: none;">
						<a class="ma" href="javascript:getBoard('noticeboard.do?method=setMenu&cono=6&nbname=','공지사항');">공지사항</a>&nbsp;|&nbsp;
						<a class="ma" href="javascript:getBoard('noticeboard.do?method=getList&cono=8&nbname=','ITEA 뉴스');">ITEA 뉴스</a>&nbsp;|&nbsp;
						<a class="ma" href="javascript:getBoard('freeboard.do?method=getList&cono=5&fbname=','자유게시판');">자유게시판</a>&nbsp;|&nbsp;
						<a class="ma" href="javascript:getBoard('qnaboard.do?method=list&cono=5&qbname=','QnA게시판');">QnA게시판</a>&nbsp;|&nbsp;
					</div>						
					<div id="databoardlayer" class="submenu" style="display: none;">
						<a class="ma" href="javascript:getBoard('databoard.do?method=getList&cono=7&dbname=','일본어자료실');">일본어자료실</a>&nbsp;|&nbsp;
						<a class="ma" href="javascript:getBoard('databoard.do?method=getList&cono=7&dbname=','일본어강좌');">일본어강좌</a>&nbsp;|&nbsp;
						<a class="ma" href="javascript:getBoard('databoard.do?method=getList&cono=7&dbname=','프로그램자료실');">프로그램자료실</a>&nbsp;|&nbsp;
						<a class="ma" href="javascript:getBoard('databoard.do?method=getList&cono=7&dbname=','프로그램강좌');">프로그램강좌</a>&nbsp;|&nbsp;
					</div>
					<div id="japaninfolayer" class="submenu" style="display: none;">
						<a class="ma" href="javascript:getBoard('freeboard.do?method=getList&cono=2&fbname=','일본에서 살아남기');">일본에서 살아남기</a>&nbsp;|&nbsp;
						<a class="ma" href="javascript:getBoard('freeboard.do?method=getList&cono=2&fbname=','일본생활 필수정보');">일본생활 필수정보</a>&nbsp;|&nbsp;
						<a class="ma" href="javascript:getBoard('freeboard.do?method=getList&cono=2&fbname=','에피소드 및 경험담');">에피소드 및 경험담</a>&nbsp;|&nbsp;
						<a class="ma" href="javascript:getBoard('freeboard.do?method=getList&cono=2&fbname=','아나바다 게시판');">아나바다 게시판</a>&nbsp;|&nbsp;
					</div></td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td colspan="2">
